<?php
namespace Common\Model;
use Common\Model\AiModel;
class CommentModel extends AiModel {
    public function ToDidGetCommentInfo($did){
    	$where['ct_did']=$did;
        $select=$this->where($where)->order('ct_ctime desc')->select();
        // $select['num']=count($select);
        foreach ($select as $key => $value) {
        	$userinfo=D('User')->toIdGetUserInfo($value['ct_uid']);
        	$select[$key]['username']=$userinfo['name'];
        	$select[$key]['userhead']=$userinfo['head'];
        	$select[$key]['ct_ctime']=get_datetime($value['ct_ctime']);
        }
        return $select;
    }
}